package com.lyf.practice.config;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

/**
 * @author LYF
 * @date 2022/7/8
 */
@Aspect
@Component
@EnableAspectJAutoProxy
public class AroundAopTestAspect {
    @Around("execution(* com.lyf.practice.controller.TestController.test(..))")
    Object around(ProceedingJoinPoint pjd) throws Throwable {//,String str
        System.out.println("测试环绕...");
        //Object retVal = pjd.proceed();
        String retVal = "hhh";
        System.out.println(retVal);
        System.out.println("测试结束...");
        return retVal;
    }
}
